%main#posts-index
  = render 'layouts/navbar'
  .ui.grid
    .row
      .four.wide.column
        - if current_user
          = link_to  new_post_path, class: 'ui left icon inverted green button create-button',:id=>'new_post' do
            分享新文章
      .eight.wide.column
        .centered.column#post-index
          .ui.list
            - @posts.each_with_index do |post|
              .item#post-list
                = link_to post.title, post_path(post)
                = image_tag User.find(post.user_id).avatar.url,class:'ui image circular user-avatar',:class=>'post-list_avatar'
  = paginate @posts
:css
  #new_post{
    margin: 9rem;
    width: 9%;
  }